package cn.com.jtang.wedding.service.impl;

import java.util.List;
import java.util.Map;

import cn.com.jtang.wedding.dao.UserDao;
import cn.com.jtang.wedding.model.User;
import cn.com.jtang.wedding.service.UserManager;

public class UserManagerImpl implements UserManager{
	
	private UserDao userDao;

	public UserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	public String add(User user) {
		// TODO Auto-generated method stub
		return userDao.insert(user);
	}

	public User queryByUsername(String username) {
		// TODO Auto-generated method stub
		return userDao.queryByKey("userName", username);
	}

	public User queryById(long id) {
		// TODO Auto-generated method stub
		return userDao.queryById(id);
	}
	
	public int deleteById(Long id){
		return userDao.deleteById(id);
	}
	
	public int updateById(Long id, User user){
		return userDao.updateById(id, user);
	}
	
	public int getCount(Map<String, Object> map){
		return userDao.getCount(map);
	}
	
	public List queryAll(Map<String, Object> map, int start,int end){
		return userDao.queryAll(map, start, end, "id desc");
	}
	

}
